/**
 * Created by zhuyun on 16/4/13.
 */


module.exports = function(grunt){
    grunt.initConfig({
        jshint:{
           all: ['test.js']
        },
        watch:{
            scripts:{
                files:['src/*.coffee'],
                tasks:['jshint','coffee'],
                options:{
                    spawn: true,
                    interrupt: false
                }
            }
        },

        coffee:{
            compile:{
                files:{
                    'compile.js':'src/test.coffee'
                }
            }
        },

        clean:{
            build:{
                src:['clean/src/*.js']
            }
        },

        copy:{
            main:{
                expand: true,
                src: 'src/*',
                dest: 'dest/'
            },
            test:{
                files:[{
                    expand: true,
                    cwd:'src/',
                    src:['*'],
                    dest:'dist/',
                    rename:function(dest, src){
                        return dest+src+'controller';
                    }
                }]
            }
        }

    })

    grunt.loadNpmTasks('grunt-contrib-jshint')
    grunt.loadNpmTasks('grunt-contrib-watch')
    grunt.loadNpmTasks('grunt-contrib-coffee')
    grunt.loadNpmTasks('grunt-contrib-clean')
    grunt.loadNpmTasks('grunt-contrib-copy')
}
